import { StdPage } from './page'

export class StdDoc {
  constructor({ docType = 1, languageType = 'zh', attachmentList = [], pageMode = 'logical', pageList = [] }) {
    // 文档类型 1:企业标准 2:通用文件 3:项目专用文件
    this.docType = docType
    // 语言类型 zh:中文 en:英文 both:中英文
    this.languageType = languageType
    // 附件信息
    this.attachmentList = attachmentList.map((i) => new StdAttachment(i))
    // 分页模式 physical:物理分页 logical:逻辑分页（场景:人工分页）
    this.pageMode = pageMode
    // 按页聚合
    this.pageList = pageList.map((i) => new StdPage(i))
  }
}

class StdAttachment {
  constructor({ name, url }) {
    // 附件名称
    this.name = name
    // 附件链接
    this.url = url
  }
}
